Skip to content

[glue] DKG+reshare#4131

Open
clabby wants to merge 30 commits into
mainfrom
cl/glue-reshare
Open

[glue] DKG+reshare#4131
clabby wants to merge 30 commits into
mainfrom
cl/glue-reshare

Conversation

@clabby

@clabby clabby commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Overview

Adds a standard, state-sync capable DKG+reshare library to commonware-glue. Protocol explained in the docs.

Explainer: https://claude.ai/artifacts/latest/bdf9c08d-cc7c-44ed-97ef-cd209e38d215

closes #3921

@clabby clabby self-assigned this Jun 29, 2026
@clabby clabby added this to Tracker Jun 29, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 29, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
commonware-mcp 85fea78 Jul 17 2026, 07:39 PM

@clabby
clabby force-pushed the cl/glue-reshare branch from a9dcb65 to 85d40dc Compare June 29, 2026 15:06
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 29, 2026

Copy link
Copy Markdown

Deploying monorepo with  Cloudflare Pages  Cloudflare Pages

Latest commit: 85fea78
Status: ✅  Deploy successful!
Preview URL: https://54b0f215.monorepo-eu0.pages.dev
Branch Preview URL: https://cl-glue-reshare.monorepo-eu0.pages.dev

View logs

@clabby clabby moved this to In Progress in Tracker Jun 29, 2026
@clabby
clabby force-pushed the cl/glue-reshare branch 4 times, most recently from 859c8d8 to fb8dd9d Compare June 29, 2026 17:55
@clabby
clabby changed the base branch from main to cl/reshare-nits June 29, 2026 17:56
@clabby
clabby force-pushed the cl/glue-reshare branch from fb8dd9d to 926a5d7 Compare June 29, 2026 18:00
@clabby
clabby force-pushed the cl/reshare-nits branch from fccf1e3 to 71d47dc Compare June 29, 2026 18:02
@clabby
clabby force-pushed the cl/glue-reshare branch 2 times, most recently from d21cf0f to 207b02f Compare June 29, 2026 18:27
@clabby
clabby force-pushed the cl/reshare-nits branch from 42b1a4b to 65b0ea7 Compare June 29, 2026 18:28
@clabby
clabby force-pushed the cl/glue-reshare branch from 207b02f to 7781b51 Compare June 29, 2026 18:28
@clabby
clabby force-pushed the cl/reshare-nits branch from 65b0ea7 to 6226e40 Compare June 29, 2026 18:29
@clabby
clabby force-pushed the cl/glue-reshare branch from 7781b51 to b7f9e1d Compare June 29, 2026 18:29
@clabby
clabby force-pushed the cl/reshare-nits branch from 6226e40 to ae6b587 Compare June 29, 2026 18:45
@clabby
clabby force-pushed the cl/glue-reshare branch 2 times, most recently from 9e5d2c3 to 647b9b5 Compare June 29, 2026 20:54
Base automatically changed from cl/reshare-nits to main June 29, 2026 21:32
@clabby
clabby force-pushed the cl/glue-reshare branch 2 times, most recently from 3708d04 to dbfddd4 Compare June 30, 2026 18:46
@commonwarexyz commonwarexyz deleted a comment from github-actions Bot Jul 1, 2026
@clabby
clabby marked this pull request as ready for review July 1, 2026 22:05
Comment thread glue/src/dkg/orchestrator/actor.rs
Comment thread glue/src/dkg/reshare/actor/setup.rs Outdated
@clabby
clabby force-pushed the cl/glue-reshare branch from c05cd9d to c5968fd Compare July 1, 2026 22:18

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 53f0738. Configure here.

Comment thread glue/src/dkg/anchor/actor/discovery.rs
Comment thread glue/src/dkg/orchestrator/actor.rs
@clabby
clabby force-pushed the cl/glue-reshare branch from 53f0738 to 87d7d31 Compare July 17, 2026 16:42
@clabby
clabby force-pushed the cl/glue-reshare branch from 87d7d31 to b420100 Compare July 17, 2026 17:05
clabby added 2 commits July 17, 2026 13:30
A participants provider set that passes max_participants but whose
dealer quorum exceeds the epoch dealer-log slots was embedded into
finalized EpochInfo unchecked. Two epochs later every node re-derives
the boundary info from the chain and panics in setup, permanently.
Reject the set at embed time, before it can poison the chain.
enter_epoch unwrapped every mux registration, so a vote/resolver muxer
exiting on the stop signal (or the externally owned certificate mux
stopping) mid-transition panicked the orchestrator instead of stopping
it. The gate wait also polled the marked gate before the shutdown
signal, making the race deterministic once the fence advanced. Treat a
closed mux as a clean stop and poll shutdown first.
@clabby
clabby force-pushed the cl/glue-reshare branch 2 times, most recently from 2d4a7f8 to c5bc86e Compare July 17, 2026 17:48
clabby added 2 commits July 17, 2026 13:50
Marshal cancels pending mailbox reads when it exits, so a boundary
block read racing shutdown resolved None and the orchestrator panicked
with the operator-facing retention-violation message on an intact
archive (startup resolution also misread the canceled processed-height
as a fresh node). Recheck the stop signal after a failed read and stop
cleanly instead.
FailedCeremonyCarryOver read both boundaries from one reference node,
failing correct runs when that node state-synced past the previous
boundary (its floor excludes height 31 while the property needs it).
Read the pre-floor boundary from whichever node retains it, and demand
the carry-over boundary from the state-synced node itself whenever its
floor covers that height. Apply the retaining-node read to
BoundaryOutputMode, which sampled a single node the same way.
@clabby
clabby force-pushed the cl/glue-reshare branch from c5bc86e to 3604081 Compare July 17, 2026 17:51
let response_epoch = finalization.epoch();
let sample_scheme = self.provider.scheme(self.minimum_epoch)?;
if sample_scheme.participants().position(&peer).is_none() {
commonware_p2p::block!(self.blocker, peer, "finalization sent by non-participant");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can happen if the validator was added after the minimum epoch?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think so—we only send the request to participants in the configured minimum epoch. A validator added later wouldn’t receive one, so a response from it would be unsolicited. The response can still carry a newer-epoch finalization; we verify that certificate against the newer epoch’s scheme.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.42975% with 458 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.05%. Comparing base (0af22f9) to head (85fea78).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
glue/src/dkg/anchor/actor/discovery.rs 88.00% 44 Missing and 13 partials ⚠️
glue/src/dkg/reshare/actor/inclusion.rs 89.93% 35 Missing and 15 partials ⚠️
glue/src/dkg/reshare/actor/dkg.rs 67.85% 39 Missing and 6 partials ⚠️
glue/src/dkg/orchestrator/actor.rs 87.71% 31 Missing and 11 partials ⚠️
glue/src/dkg/reshare/actor/dealing.rs 86.53% 34 Missing and 8 partials ⚠️
glue/src/dkg/types.rs 87.96% 24 Missing and 5 partials ⚠️
glue/src/dkg/reshare/store.rs 96.49% 15 Missing and 10 partials ⚠️
glue/src/dkg/reshare/application.rs 94.95% 17 Missing and 7 partials ⚠️
glue/src/dkg/reshare/mailbox.rs 79.04% 21 Missing and 1 partial ⚠️
consensus/src/marshal/ancestry.rs 85.82% 19 Missing ⚠️
... and 18 more
@@            Coverage Diff             @@
##             main    #4131      +/-   ##
==========================================
- Coverage   95.06%   95.05%   -0.02%     
==========================================
  Files         573      595      +22     
  Lines      238812   245539    +6727     
  Branches     5804     5993     +189     
==========================================
+ Hits       227028   233389    +6361     
- Misses       9873    10154     +281     
- Partials     1911     1996      +85     
Files with missing lines Coverage Δ
consensus/src/lib.rs 100.00% <ø> (+78.57%) ⬆️
consensus/src/marshal/coding/marshaled.rs 85.56% <100.00%> (+0.03%) ⬆️
consensus/src/marshal/standard/deferred.rs 96.31% <100.00%> (+0.12%) ⬆️
consensus/src/types.rs 95.62% <100.00%> (+0.01%) ⬆️
glue/src/dkg/fence.rs 100.00% <100.00%> (ø)
glue/src/simulate/action.rs 85.00% <ø> (ø)
glue/src/simulate/plan.rs 88.06% <100.00%> (+0.65%) ⬆️
glue/src/simulate/reporter.rs 100.00% <100.00%> (ø)
glue/src/stateful/actor/core/mailbox.rs 74.50% <100.00%> (+0.50%) ⬆️
glue/src/stateful/actor/core/mod.rs 91.85% <100.00%> (+0.03%) ⬆️
... and 33 more

... and 49 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0af22f9...85fea78. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for Review

Development

Successfully merging this pull request may close these issues.

[glue] Add standard DKG/reshare

2 participants